namespace InventoryManagement
{
	using System;
	using System.Collections;
	using System.Collections.Generic;
	using System.ComponentModel;
	using System.Data;
	using System.Data.SqlClient;
	using System.Text;
	
	
	public class CR_Storage : BaseTable
	{
		
		#region Static SQL String Members
		/// <remarks>This field represents the full SELECT string for the table CR Storage, with the WHERE clause.</remarks>
        internal static string _SQL_Select = @"SELECT [ID], [LabelName], [wfStatus], [Date], [ID_Storage], [Configuration], [URLAttachment], [CR_VLAN], [CR_LogicalConnection], [CR_Interface], [CR_System], [Location], [IP], [HostName], [RackNumber], [SystemClass], [InventoryBy] FROM [dbo].[CR Storage] WHERE [ID]=@ID ";
		
		/// <remarks>This field represents the full SELECT string for the table CR Storage, with the WHERE clause.</remarks>
        internal static string _SQL_SelectByParam = "SELECT [ID], [LabelName], [wfStatus], [Date], [ID_Storage], [Configuration], [URLAttachment], [CR_VLAN], [CR_LogicalConnection], [CR_Interface], [CR_System], [Location], [IP], [HostName], [RackNumber], [SystemClass], [InventoryBy] FROM [dbo].[CR Storage] WHERE isnull(convert(varchar(36),[ID]),\'true\')=isnull(convert(varchar(36),@ID),isnull(convert(varchar(36),[ID]),\'true\')) AND isnull(convert(varchar,[LabelName]),\'true\')=isnull(convert(varchar,@LabelName),isnull(convert(varchar,[LabelName]),\'true\')) AND isnull(convert(varchar,[wfStatus]),\'true\')=isnull(convert(varchar,@wfStatus),isnull(convert(varchar,[wfStatus]),\'true\')) AND isnull(convert(varchar,[Date]),\'true\')=isnull(convert(varchar,@Date),isnull(convert(varchar,[Date]),\'true\')) AND isnull(convert(varchar(36),[ID_Storage]),\'true\')=isnull(convert(varchar(36),@ID_Storage),isnull(convert(varchar(36),[ID_Storage]),\'true\')) AND isnull(convert(varchar,[Configuration]),\'true\')=isnull(convert(varchar,@Configuration),isnull(convert(varchar,[Configuration]),\'true\')) AND isnull(convert(varchar,[URLAttachment]),\'true\')=isnull(convert(varchar,@URLAttachment),isnull(convert(varchar,[URLAttachment]),\'true\')) AND isnull(convert(varchar,[CR_VLAN]),\'true\')=isnull(convert(varchar,@CR_VLAN),isnull(convert(varchar,[CR_VLAN]),\'true\')) AND isnull(convert(varchar,[CR_LogicalConnection]),\'true\')=isnull(convert(varchar,@CR_LogicalConnection),isnull(convert(varchar,[CR_LogicalConnection]),\'true\')) AND isnull(convert(varchar,[CR_Interface]),\'true\')=isnull(convert(varchar,@CR_Interface),isnull(convert(varchar,[CR_Interface]),\'true\')) AND isnull(convert(varchar,[CR_System]),\'true\')=isnull(convert(varchar,@CR_System),isnull(convert(varchar,[CR_System]),\'true\')) AND isnull(convert(varchar,[Location]),\'true\')=isnull(convert(varchar,@Location),isnull(convert(varchar,[Location]),\'true\')) AND isnull(convert(varchar,[IP]),\'true\')=isnull(convert(varchar,@IP),isnull(convert(varchar,[IP]),\'true\')) AND isnull(convert(varchar,[HostName]),\'true\')=isnull(convert(varchar,@HostName),isnull(convert(varchar,[HostName]),\'true\')) AND isnull(convert(varchar,[RackNumber]),\'true\')=isnull(convert(varchar,@RackNumber),isnull(convert(varchar,[RackNumber]),\'true\')) AND isnull(convert(varchar,[SystemClass]),\'true\')=isnull(convert(varchar,@SystemClass),isnull(convert(varchar,[SystemClass]),\'true\')) AND isnull(convert(varchar,[InventoryBy]),\'true\')=isnull(convert(varchar,@InventoryBy),isnull(convert(varchar,[InventoryBy]),\'true\')) ";
		
		/// <remarks>This field represents the full INSERT INTO string for the table CR Storage.</remarks>
        internal static string _SQL_Insert = @"INSERT INTO [dbo].[CR Storage] ([ID], [LabelName], [wfStatus], [Date], [ID_Storage], [Configuration], [URLAttachment], [CR_VLAN], [CR_LogicalConnection], [CR_Interface], [CR_System], [Location], [IP], [HostName], [RackNumber], [SystemClass], [InventoryBy]) VALUES(@ID, @LabelName, @wfStatus, @Date, @ID_Storage, @Configuration, @URLAttachment, @CR_VLAN, @CR_LogicalConnection, @CR_Interface, @CR_System, @Location, @IP, @HostName, @RackNumber, @SystemClass, @InventoryBy) ";
		
		/// <remarks>This field represents the full UPDATE string for the table CR Storage, with the WHERE clause.</remarks>
        internal static string _SQL_Update = @"UPDATE [dbo].[CR Storage] SET [ID] = @ID, [LabelName] = @LabelName, [wfStatus] = @wfStatus, [Date] = @Date, [ID_Storage] = @ID_Storage, [Configuration] = @Configuration, [URLAttachment] = @URLAttachment, [CR_VLAN] = @CR_VLAN, [CR_LogicalConnection] = @CR_LogicalConnection, [CR_Interface] = @CR_Interface, [CR_System] = @CR_System, [Location] = @Location, [IP] = @IP, [HostName] = @HostName, [RackNumber] = @RackNumber, [SystemClass] = @SystemClass, [InventoryBy] = @InventoryBy WHERE [ID]=@ID ";
		
		/// <remarks>This field represents the DELETE string for the table CR Storage, with the WHERE clause.</remarks>
		internal static string _SQL_Delete = "DELETE FROM [dbo].[CR Storage] WHERE [ID]=@ID ";
		#endregion
		
		#region Tables Members
		/// <remarks>SQL Type:uniqueidentifier - </remarks>
		private System.Nullable<System.Guid> _ID;
		
		[DisplayName("ID")]
		[Category("Primary Key")]
		public System.Nullable<System.Guid> ID
		{
			get
			{
				try
				{
					return _ID;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting ID", err);
				}
			}
			set
			{
				try
				{
					_ID = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting ID", err);
				}
			}
		}

        /// <remarks>SQL Type:varchar - </remarks>
        private string _LabelName;

        [DisplayName("LabelName")]
        [Category("Column")]
        public string LabelName
        {
            get
            {
                try
                {
                    return _LabelName;
                }
                catch (System.Exception err)
                {
                    throw new Exception("Error getting LabelName", err);
                }
            }
            set
            {
                try
                {
                    if ((value.Length <= 200))
                    {
                        _LabelName = value;
                    }
                    else
                    {
                        throw new OverflowException("Error setting LabelName, Length of value is to long. Maximum Length: 200");
                    }
                }
                catch (System.Exception err)
                {
                    throw new Exception("Error setting wfStatus", err);
                }
            }
        }
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _wfStatus;
		
		[DisplayName("wf Status")]
		[Category("Column")]
		public string wfStatus
		{
			get
			{
				try
				{
					return _wfStatus;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting wfStatus", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 200))
					{
						_wfStatus = value;
					}
					else
					{
						throw new OverflowException("Error setting wfStatus, Length of value is to long. Maximum Length: 200");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting wfStatus", err);
				}
			}
		}
		
		/// <remarks>SQL Type:datetime - </remarks>
		private System.Nullable<System.DateTime> _Date;
		
		[DisplayName("Date")]
		[Category("Column")]
		public System.Nullable<System.DateTime> Date
		{
			get
			{
				try
				{
					return _Date;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting Date", err);
				}
			}
			set
			{
				try
				{
					_Date = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting Date", err);
				}
			}
		}
		
		/// <remarks>SQL Type:uniqueidentifier - </remarks>
		private System.Nullable<System.Guid> _ID_Storage;
		
		[DisplayName("ID_Storage")]
		[Category("Foreign Key")]
		public System.Nullable<System.Guid> ID_Storage
		{
			get
			{
				try
				{
					return _ID_Storage;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting ID_Storage", err);
				}
			}
			set
			{
				try
				{
					_ID_Storage = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting ID_Storage", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _Configuration;
		
		[DisplayName("Configuration")]
		[Category("Column")]
		public string Configuration
		{
			get
			{
				try
				{
					return _Configuration;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting Configuration", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 200))
					{
						_Configuration = value;
					}
					else
					{
						throw new OverflowException("Error setting Configuration, Length of value is to long. Maximum Length: 200");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting Configuration", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _URLAttachment;
		
		[DisplayName("URLAttachment")]
		[Category("Column")]
		public string URLAttachment
		{
			get
			{
				try
				{
					return _URLAttachment;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting URLAttachment", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 400))
					{
						_URLAttachment = value;
					}
					else
					{
						throw new OverflowException("Error setting URLAttachment, Length of value is to long. Maximum Length: 400");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting URLAttachment", err);
				}
			}
		}
		
		/// <remarks>SQL Type:bit - </remarks>
		private System.Nullable<bool> _CR_VLAN;
		
		[DisplayName("CR_VLAN")]
		[Category("Column")]
		public System.Nullable<bool> CR_VLAN
		{
			get
			{
				try
				{
					return _CR_VLAN;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting CR_VLAN", err);
				}
			}
			set
			{
				try
				{
					_CR_VLAN = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting CR_VLAN", err);
				}
			}
		}
		
		/// <remarks>SQL Type:bit - </remarks>
		private System.Nullable<bool> _CR_LogicalConnection;
		
		[DisplayName("CR_Logical Connection")]
		[Category("Column")]
		public System.Nullable<bool> CR_LogicalConnection
		{
			get
			{
				try
				{
					return _CR_LogicalConnection;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting CR_LogicalConnection", err);
				}
			}
			set
			{
				try
				{
					_CR_LogicalConnection = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting CR_LogicalConnection", err);
				}
			}
		}
		
		/// <remarks>SQL Type:bit - </remarks>
		private System.Nullable<bool> _CR_Interface;
		
		[DisplayName("CR_Interface")]
		[Category("Column")]
		public System.Nullable<bool> CR_Interface
		{
			get
			{
				try
				{
					return _CR_Interface;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting CR_Interface", err);
				}
			}
			set
			{
				try
				{
					_CR_Interface = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting CR_Interface", err);
				}
			}
		}
		
		/// <remarks>SQL Type:bit - </remarks>
		private System.Nullable<bool> _CR_System;
		
		[DisplayName("CR_System")]
		[Category("Column")]
		public System.Nullable<bool> CR_System
		{
			get
			{
				try
				{
					return _CR_System;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting CR_System", err);
				}
			}
			set
			{
				try
				{
					_CR_System = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting CR_System", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _Location;
		
		[DisplayName("Location")]
		[Category("Column")]
		public string Location
		{
			get
			{
				try
				{
					return _Location;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting Location", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 400))
					{
						_Location = value;
					}
					else
					{
						throw new OverflowException("Error setting Location, Length of value is to long. Maximum Length: 400");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting Location", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _IP;
		
		[DisplayName("IP")]
		[Category("Column")]
		public string IP
		{
			get
			{
				try
				{
					return _IP;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting IP", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 400))
					{
						_IP = value;
					}
					else
					{
						throw new OverflowException("Error setting IP, Length of value is to long. Maximum Length: 400");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting IP", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _HostName;
		
		[DisplayName("Host Name")]
		[Category("Column")]
		public string HostName
		{
			get
			{
				try
				{
					return _HostName;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting HostName", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 400))
					{
						_HostName = value;
					}
					else
					{
						throw new OverflowException("Error setting HostName, Length of value is to long. Maximum Length: 400");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting HostName", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _RackNumber;
		
		[DisplayName("Rack Number")]
		[Category("Column")]
		public string RackNumber
		{
			get
			{
				try
				{
					return _RackNumber;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting RackNumber", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 200))
					{
						_RackNumber = value;
					}
					else
					{
						throw new OverflowException("Error setting RackNumber, Length of value is to long. Maximum Length: 200");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting RackNumber", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _SystemClass;
		
		[DisplayName("System Class")]
		[Category("Column")]
		public string SystemClass
		{
			get
			{
				try
				{
					return _SystemClass;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting SystemClass", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 400))
					{
						_SystemClass = value;
					}
					else
					{
						throw new OverflowException("Error setting SystemClass, Length of value is to long. Maximum Length: 400");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting SystemClass", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _InventoryBy;
		
		[DisplayName("Inventory By")]
		[Category("Column")]
		public string InventoryBy
		{
			get
			{
				try
				{
					return _InventoryBy;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting InventoryBy", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 400))
					{
						_InventoryBy = value;
					}
					else
					{
						throw new OverflowException("Error setting InventoryBy, Length of value is to long. Maximum Length: 400");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting InventoryBy", err);
				}
			}
		}
		#endregion
		
		#region Related Objects
		/// <remarks>Represents the foreign key object</remarks>
		private Inventory_Storage _ID_Storage_Inventory_Storage;
		
		[Description("Represents the foreign key object of the type Inventory_Storage")]
		public Inventory_Storage ID_Storage_Inventory_Storage
		{
			get
			{
				try
				{
					return _ID_Storage_Inventory_Storage;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting ID_Storage_Inventory_Storage", err);
				}
			}
			set
			{
				try
				{
					_ID_Storage_Inventory_Storage = value;
					_ID_Storage = _ID_Storage_Inventory_Storage.ID;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting ID_Storage_Inventory_Storage", err);
				}
			}
		}
		#endregion
		
		#region Public Methods
		public void Select()
		{
			try
			{
				SqlConnection Conn = new SqlConnection(_connString);
				SqlCommand Com = Conn.CreateCommand();
				Com.CommandText = CR_Storage._SQL_Select;
				Com.Parameters.AddRange(GetSqlParameters());
				Conn.Open();
				SqlDataReader rs = Com.ExecuteReader();
				while(rs.Read())
				{
					AddFromRecordSet(rs);
				}
				rs.Close();
				Conn.Close();
				rs.Dispose();
				Com.Dispose();
				Conn.Dispose();
			}
			catch (System.Exception )
			{
				throw;
			}
		}
		
		public System.Data.DataTable SelectByParam()
		{
			try
			{
				SqlConnection Conn = new SqlConnection(_connString);
				SqlCommand Com = Conn.CreateCommand();
				Com.CommandText = CR_Storage._SQL_SelectByParam;
				Com.Parameters.AddRange(GetSqlParameters());
				Conn.Open();
				SqlDataAdapter objDataAdapter = new SqlDataAdapter(Com);
				DataTable objDataTable = new DataTable();
				objDataAdapter.Fill(objDataTable);
				Conn.Close();
				Com.Dispose();
				Conn.Dispose();
				return objDataTable;
			}
			catch (System.Exception )
			{
				throw;
			}
		}
		
		public int Insert()
		{
			try
			{
				SqlConnection Conn = new SqlConnection(_connString);
				SqlCommand Com = Conn.CreateCommand();
				Com.CommandText = CR_Storage._SQL_Insert;
				Com.Parameters.AddRange(GetSqlParameters());
				Conn.Open();
				int rowseffected = Com.ExecuteNonQuery();
				Conn.Close();
				Com.Dispose();
				Conn.Dispose();
				return rowseffected;
			}
			catch (System.Exception )
			{
				throw;
			}
		}
		
		public int Update()
		{
			try
			{
				SqlConnection Conn = new SqlConnection(_connString);
				SqlCommand Com = Conn.CreateCommand();
				Com.CommandText = CR_Storage._SQL_Update;
				Com.Parameters.AddRange(GetSqlParameters());
				Conn.Open();
				int rowseffected = Com.ExecuteNonQuery();
				Conn.Close();
				Com.Dispose();
				Conn.Dispose();
				return rowseffected;
			}
			catch (System.Exception )
			{
				throw;
			}
		}
		
		public int Delete()
		{
			try
			{
				SqlConnection Conn = new SqlConnection(_connString);
				SqlCommand Com = Conn.CreateCommand();
				Com.CommandText = CR_Storage._SQL_Delete;
				Com.Parameters.AddRange(GetSqlParameters());
				Conn.Open();
				int rowseffected = Com.ExecuteNonQuery();
				Conn.Close();
				Com.Dispose();
				Conn.Dispose();
				return rowseffected;
			}
			catch (System.Exception )
			{
				throw;
			}
		}
		
		public string[] GetSqlCommandStrings()
		{
			try
			{
				string[] CommStr = new string[4];
				CommStr[0] = "SELECT [ID], [wfStatus], [Date], [ID_Storage], [Configuration], [URLAttachment], [CR_VLAN], [CR_LogicalConnection], [CR_Interface], [CR_System], [Location], [IP], [HostName], [RackNumber], [SystemClass], [InventoryBy] FROM [dbo].[CR Storage] WHERE [ID] = " + _ID + "";
				CommStr[1] = "INSERT INTO [dbo].[CR Storage] ([ID], [wfStatus], [Date], [ID_Storage], [Configuration], [URLAttachment], [CR_VLAN], [CR_LogicalConnection], [CR_Interface], [CR_System], [Location], [IP], [HostName], [RackNumber], [SystemClass], [InventoryBy]) VALUES(" + _ID + ", '" + _wfStatus.Replace("'","''") + "', '" + _Date + "', " + _ID_Storage + ", '" + _Configuration.Replace("'","''") + "', '" + _URLAttachment.Replace("'","''") + "', " + _CR_VLAN + ", " + _CR_LogicalConnection + ", " + _CR_Interface + ", " + _CR_System + ", '" + _Location.Replace("'","''") + "', '" + _IP.Replace("'","''") + "', '" + _HostName.Replace("'","''") + "', '" + _RackNumber.Replace("'","''") + "', '" + _SystemClass.Replace("'","''") + "', '" + _InventoryBy.Replace("'","''") + "')";
				CommStr[2] = "UPDATE [dbo].[CR Storage] SET [wfStatus] = '" + _wfStatus.Replace("'","''") + "' ,[Date] = '" + _Date + "' ,[ID_Storage] = " + _ID_Storage + " ,[Configuration] = '" + _Configuration.Replace("'","''") + "' ,[URLAttachment] = '" + _URLAttachment.Replace("'","''") + "' ,[CR_VLAN] = " + _CR_VLAN + " ,[CR_LogicalConnection] = " + _CR_LogicalConnection + " ,[CR_Interface] = " + _CR_Interface + " ,[CR_System] = " + _CR_System + " ,[Location] = '" + _Location.Replace("'","''") + "' ,[IP] = '" + _IP.Replace("'","''") + "' ,[HostName] = '" + _HostName.Replace("'","''") + "' ,[RackNumber] = '" + _RackNumber.Replace("'","''") + "' ,[SystemClass] = '" + _SystemClass.Replace("'","''") + "' ,[InventoryBy] = '" + _InventoryBy.Replace("'","''") + "' WHERE [ID] = " + _ID + "";
				CommStr[3] = "DELETE FROM [dbo].[CR Storage] WHERE [ID] = " + _ID + "";
				return CommStr;
			}
			catch (System.Exception )
			{
				throw;
			}
		}
		#endregion
		
		#region Private Methods
		private void AddFromRecordSet(SqlDataReader rs)
		{
			try
			{
				// if value from the recordset, to the ID field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("ID")) == false))
				{
					ID = rs.GetGuid(rs.GetOrdinal("ID"));
				}
                // if value from the recordset, to the LabelName field is NOT null then set the value.
                if ((rs.IsDBNull(rs.GetOrdinal("LabelName")) == false))
                {
                    LabelName = rs.GetString(rs.GetOrdinal("LabelName"));
                }
				// if value from the recordset, to the wfStatus field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("wfStatus")) == false))
				{
					wfStatus = rs.GetString(rs.GetOrdinal("wfStatus"));
				}
				// if value from the recordset, to the Date field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("Date")) == false))
				{
					Date = rs.GetDateTime(rs.GetOrdinal("Date"));
				}
				// if value from the recordset, to the ID_Storage field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("ID_Storage")) == false))
				{
					ID_Storage = rs.GetGuid(rs.GetOrdinal("ID_Storage"));
				}
				// if value from the recordset, to the Configuration field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("Configuration")) == false))
				{
					Configuration = rs.GetString(rs.GetOrdinal("Configuration"));
				}
				// if value from the recordset, to the URLAttachment field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("URLAttachment")) == false))
				{
					URLAttachment = rs.GetString(rs.GetOrdinal("URLAttachment"));
				}
				// if value from the recordset, to the CR_VLAN field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("CR_VLAN")) == false))
				{
					CR_VLAN = rs.GetBoolean(rs.GetOrdinal("CR_VLAN"));
				}
				// if value from the recordset, to the CR_LogicalConnection field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("CR_LogicalConnection")) == false))
				{
					CR_LogicalConnection = rs.GetBoolean(rs.GetOrdinal("CR_LogicalConnection"));
				}
				// if value from the recordset, to the CR_Interface field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("CR_Interface")) == false))
				{
					CR_Interface = rs.GetBoolean(rs.GetOrdinal("CR_Interface"));
				}
				// if value from the recordset, to the CR_System field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("CR_System")) == false))
				{
					CR_System = rs.GetBoolean(rs.GetOrdinal("CR_System"));
				}
				// if value from the recordset, to the Location field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("Location")) == false))
				{
					Location = rs.GetString(rs.GetOrdinal("Location"));
				}
				// if value from the recordset, to the IP field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("IP")) == false))
				{
					IP = rs.GetString(rs.GetOrdinal("IP"));
				}
				// if value from the recordset, to the HostName field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("HostName")) == false))
				{
					HostName = rs.GetString(rs.GetOrdinal("HostName"));
				}
				// if value from the recordset, to the RackNumber field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("RackNumber")) == false))
				{
					RackNumber = rs.GetString(rs.GetOrdinal("RackNumber"));
				}
				// if value from the recordset, to the SystemClass field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("SystemClass")) == false))
				{
					SystemClass = rs.GetString(rs.GetOrdinal("SystemClass"));
				}
				// if value from the recordset, to the InventoryBy field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("InventoryBy")) == false))
				{
					InventoryBy = rs.GetString(rs.GetOrdinal("InventoryBy"));
				}
			}
			catch (SqlException sqlExc)
			{
				throw sqlExc;
			}
			catch (Exception Exc)
			{
				throw Exc;
			}
		}
		
		private SqlParameter[] GetSqlParameters()
		{
			List<SqlParameter> SqlParmColl = new List<SqlParameter>();
			try
			{
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@ID", ID, SqlDbType.UniqueIdentifier));
                SqlParmColl.Add(InventoryManagement.AddSqlParm("@LabelName", LabelName, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@wfStatus", wfStatus, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@Date", Date, SqlDbType.DateTime));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@ID_Storage", ID_Storage, SqlDbType.UniqueIdentifier));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@Configuration", Configuration, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@URLAttachment", URLAttachment, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@CR_VLAN", CR_VLAN, SqlDbType.Bit));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@CR_LogicalConnection", CR_LogicalConnection, SqlDbType.Bit));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@CR_Interface", CR_Interface, SqlDbType.Bit));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@CR_System", CR_System, SqlDbType.Bit));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@Location", Location, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@IP", IP, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@HostName", HostName, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@RackNumber", RackNumber, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@SystemClass", SystemClass, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@InventoryBy", InventoryBy, SqlDbType.VarChar));
				return SqlParmColl.ToArray();
			}
			catch (Exception Exc)
			{
				throw Exc;
			}
		}
		#endregion
	}
	
	public class CR_StorageCollection : System.Collections.CollectionBase
	{
		
		[Description("Adds a new CR_Storage to the collection.")]
		public int Add(CR_Storage item)
		{
			int newindex = List.Add(item);
			return newindex;
		}
		
		[Description("Removes a CR_Storage from the collection.")]
		public void Remove(CR_Storage item)
		{
			List.Remove(item);
		}
		
		[Description("Inserts an CR_Storage into the collection at the specified index.")]
		public void Insert(int index, CR_Storage item)
		{
			List.Insert(index, item);
		}
		
		[Description("Returns the index value of the CR_Storage class in the collection.")]
		public int IndexOf(CR_Storage item)
		{
			return List.IndexOf(item);
		}
		
		[Description("Returns true if the CR_Storage class is present in the collection.")]
		public bool Contains(CR_Storage item)
		{
			return List.Contains(item);
		}
	}
	
	public enum CR_Storage_Fields
	{
		
		ID,
		
		wfStatus,
		
		Date,
		
		ID_Storage,
		
		Configuration,
		
		URLAttachment,
		
		CR_VLAN,
		
		CR_LogicalConnection,
		
		CR_Interface,
		
		CR_System,
		
		Location,
		
		IP,
		
		HostName,
		
		RackNumber,
		
		SystemClass,
		
		InventoryBy,
	}
}
